﻿var SelectareStatusConcediuPage = function(pageContainer) {

    SelectareStatusConcediuPage.superclass.constructor.call(this, pageContainer);

    var self = this;
    var currentCallback = null;

    this.CanGoBack = false;
    this.isPopup = true;
    var Elements = {
        list: pageContainer.find(".list")
    };

    this.refresh = function(callback) {
        currentCallback = callback;
    };

    self.initialize = override(self.initialize, function() {
        self.Title = translate('Module_Title_SelectareStatusConcediu');
        app.translatePage(app.Pages.SelectareStatusConcediu);

        pageContainer.bind('onBeforePageShow', function() {
            app.Phone.setBackbtnVisible(true);
        });

        Elements.list.find('.list-element').click(function(e) {
            if (!currentCallback)
                return;
            currentCallback({
                Id: $(this).parent().attr('value'),
                Nume: $(this).parent().find('.element-value').html()
            });

            return Event.stopEvent(e);
        });
    });

    this.setModuleAction = override(self.setModuleAction, function() {
        if (app.Phone)
            app.Phone.setModuleAction(ModuleActions.None);
    });
};
extend(SelectareStatusConcediuPage, TMMobilePage);